package src.string;

public class no344 {
    //反转字符串，字符串为字符数组
    public static void main(String[] args) {
        char[] s = {'1','2','a','b','c','d'};
        System.out.println(reverseString(s));

    }

    public static char[] reverseString(char[] s) {
        int i = 0, j = s.length - 1;
        while (i < j) {
            char temp = s[i];
            s[i] = s[j];
            s[j] = temp;
            i++;
            j--;
        }
        return s;

    }
}
